#include <iostream>
#include <SFML/Graphics/RenderWindow.hpp>
#include <nice2d/application.h>
#include <nice2d/text.h>
#include <nice2d/components/fps.h>
#include <nice2d/components/fontmanager.h>

int main()
{
    auto window = std::make_shared<sf::RenderWindow>(sf::VideoMode(800, 600), "unit03",
                                                     sf::Style::Close);
    window->setVerticalSyncEnabled(true);

    auto app = Application::getInstance();
    app->addComponent<Fps>("Fps");
    app->addComponent<FontManager>("FontManager");
    app->setBackgroundColor(sf::Color::Blue);
    app->setWindow(window);

    auto node = std::make_shared<Node>();
    auto fps = std::make_shared<Text>();
    fps->setCharacterSize(16);
    fps->setTextColor(sf::Color::White);
    fps->setBackgroundColor(sf::Color::Transparent);
    fps->setFont("./../data/font/arial.ttf");
    fps->setText("nice2d");
    fps->setPosition(6, 6);
    node->addChild(fps);

    app->execute(node);
    return 0;
}
